package com.shop.cereshop.business.dl.logic.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.business.dao.dl.CereShopAnnouncementDao;
import com.shop.cereshop.business.dl.logic.domain.CereShopAnnouncement;
import com.shop.cereshop.business.dl.logic.service.CereShopAnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: 况鑫威
 * @Date: 2021/7/22
 * @Time: 16:14
 * @ClassName: CereShopAnnouncementServiceImpl
 * @Description: com.shop.cereshop.app.dl.logic.service.Impl
 */
@Service
public class CereShopAnnouncementServiceImpl implements CereShopAnnouncementService {
    @Autowired
    private CereShopAnnouncementDao cereShopAnnouncementDao;
    
    @Override
    public int deleteByPrimaryKey(Long announcementId) {
        return cereShopAnnouncementDao.deleteByPrimaryKey(announcementId);
    }

    @Override
    public int insert(CereShopAnnouncement record) {
        return cereShopAnnouncementDao.insert(record);
    }

    @Override
    public int insertSelective(CereShopAnnouncement record) {
        return cereShopAnnouncementDao.insertSelective(record);
    }

    @Override
    public CereShopAnnouncement selectByPrimaryKey(Long announcementId) {
        return cereShopAnnouncementDao.selectByPrimaryKey(announcementId);
    }

    @Override
    public int updateByPrimaryKeySelective(CereShopAnnouncement record) {
        return cereShopAnnouncementDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(CereShopAnnouncement record) {
        return cereShopAnnouncementDao.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo<?> getAnnouncements(String announcementType, Integer page, Integer row) {
        PageHelper.startPage(page, row);
        return new PageInfo<>(cereShopAnnouncementDao.cereShopAnnouncementDao(announcementType));
    }
}
